<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport"
        content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="__CSS__/ex/common.css">
    <link rel="stylesheet" href="__CSS__/ex/login.css">
    <title>WESTGOLDB.EXC</title>
    <script src="__JS__/ios-web-app.js"></script>
</head>

<body style="padding-top: 38px">
    <header class="normal_header">
        <div class="header_pic">
            <a href="javascript:history.back(-1)"><img src="__IMG__/ex/back_black.png" alt=""></a>
        </div>
        <p>Modify transaction password</p>
        <div class="header_pic"></div>
    </header>
    <section class="change_content">
        <ul class="change_ul">
            <li>
                <p>old password</p>
                <input type="text" placeholder="old password" id="password_old">
            </li>
            <li>
                <p>new password</p>
                <input type="text" placeholder="new password" id="new_password">
            </li>
            <li>
                <p>confirm password</p>
                <input type="text" placeholder="confirm password" id="sure_password">
            </li>
        </ul>
        <div class="btn login_btn lsub" id='sub'>
            confirm
        </div>
    </section>
    <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
    <script>
        $('#sub').click(function () {
            $.ajax({
                type: "post",
                url: "{:U('User/change_password2')}",
                data: {
                    password_old: $('#password_old').val(),
                    new_password: $('#new_password').val(),
                    sure_password: $('#sure_password').val(),
                },
                dataType: "json",
                success: function (data) {
                    if (data.code == 1) {
                        alert(data.msg);
                    } else {
                        alert(data.msg);
                        window.location.href = data.data;
                    }
                }
            });
        });
    </script>
</body>

</html>